package cn.dt70.utils;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class test {

    public static void main(String[] args) {
        Date time = new Date();
        int num = 3;
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
        String currdate = format.format(time);
        System.out.println("现在的日期是：" + currdate);
        Calendar ca = Calendar.getInstance();
        ca.add(Calendar.DATE, num);// num为增加的天数，可以改变的
        time = ca.getTime();
        String enddate = format.format(time);
        System.out.println("增加天数以后的日期：" + enddate);
//        return enddate;
    }
}
